﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nuzzle.Protocol.Types.Connection
{
    public class GameServerInformations
    {
        public short ID { get; set; }
        public byte Status { get; set; }
        public byte Completion { get; set; }
        public bool IsSelectable { get; set; }
        public byte CharacterCount { get; set; }
        public double Date { get; set; }

        public GameServerInformations(short id, byte status, byte completion, bool isSelectable,
                                                byte characterCount, double date)
        {
            this.ID = id;
            this.Status = status;
            this.Completion = completion;
            this.IsSelectable = isSelectable;
            this.CharacterCount = characterCount;
            this.Date = date;
        }

        public void Serialize(NetworkMessage message)
        {
            message.WriterBuffer.writeShort(this.ID);
            message.WriterBuffer.writeByte(this.Status);
            message.WriterBuffer.writeByte(this.Completion);
            message.WriterBuffer.writeBoolean(this.IsSelectable);
            message.WriterBuffer.writeByte(this.CharacterCount);
            message.WriterBuffer.writeDouble(this.Date);
        }
    }
}
